import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../pages/home";
import Login from "../pages/login";
import Music from "../pages/home/music";
import Games from "../pages/home/games";
import News from "../pages/home/news";

Vue.use(VueRouter);

export default new VueRouter({
  routes: [
    {
      path: "/home",
      component: Home,
      children: [
        {
          path: "music/:id/:time?",
          component: Music,
          name: "music",
          props: true,
        },
        {
          path: "games",
          component: Games,
          name: "games",
          props:{
            game1:'原神',
            game2:'王者荣耀',
            game3:'阴阳师',
          }
        },
        {
          path: "news",
          component: News,
          name: "news",
        },
        {
          path: "",
          component: Music,
        },
      ],
    },
    { path: "/login", component: Login, name: "login" },
    { path: "/", redirect: "/home" },
  ],
});
